<?php 

use yii\helpers\Html;
use yii\widgets\ActiveForm;


 ?>


<?php $form = ActiveForm::begin([
    'action' => Url::to(['post/save']),           //此处为请求地址 Url用法查看手册
    'enableAjaxValidation' => true,
        // 'validationUrl' => Url::to(['post/validate']),     //数据异步校验
]); ?>

    <?= $form->field($testmodel, 'name')->textInput(['maxlength' => true]) ?>
    
 <?php ActiveForm::end(); ?>